/*
 * Copyright 2012-2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.boot;

import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

/**
 * 用于指示一个 bean 在包含于 {@link SpringApplication} 中时应当被<em>运行</em>的接口。
 * 可以在同一个应用上下文中定义多个 {@link ApplicationRunner} bean，
 * 并可通过 {@link Ordered} 接口或 {@link Order @Order} 注解进行排序。
 *
 * @author Phillip Webb
 * @since 1.3.0
 * @see CommandLineRunner
 */
@FunctionalInterface
public interface ApplicationRunner {

	/**
	 * 用于运行该 bean 的回调方法。
	 * @param args 传入的应用参数
	 * @throws Exception 出现错误时抛出
	 */
	void run(ApplicationArguments args) throws Exception;

}
